﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            Tiger t = new Tiger();
            t.Leg = 4;
            t.Yeshi();
            t.Eat();
            t.Sleep();
            t.Tui();
            Console.WriteLine("---------------");
            Cat c = new Cat();
            c.Leg = 4;
            c.Yeshi();
            c.Eat();
            c.Sleep();
            c.Tui();
            c.Zhua();
            Console.WriteLine("---------------");
            Sparrow s = new Sparrow();
            s.Leg = 2;
            s.Yumao();
            s.Eat();
            s.Sleep();
            s.Tui();
            Console.WriteLine("---------------");
            Vulture v = new Vulture();
            v.Leg = 2;
            v.Yumao();
            v.Eat();
            v.Sleep();
            v.Tui();
        }
    }
 
    class Animalia 
    {
        private int leg;
        public int Leg
        {
            get { return this.leg; }
            set { this.leg = value; }
        }
        public Animalia(int leg) 
        {
            this.Leg = leg;
        }
        public Animalia() { }
        public void Tui() 
        {
            Console.WriteLine("我有"+this.Leg+"条腿。");
        }
        public void Sleep() 
        {
            Console.WriteLine("每个人都会睡觉。");
        }
        public virtual void Eat() 
        {
            Console.Write("我会吃");
        }
    }//动物类

    class Felidae :Animalia
    {
        public void Yeshi() 
        {
            Console.WriteLine("我有夜视能力。");
        }
    }//猫科
    class Birds : Animalia
    {
        public void Yumao() 
        {
            Console.WriteLine("每个鸟类都有自己的羽毛。");
        }
    }//鸟类
    class Tiger :Felidae
    {
        public override void Eat()
        {
            base.Eat();
            Console.WriteLine("马肉。");
        }
    }//老虎
    class Cat :Felidae
    {
        public void Zhua() 
        {
            Console.WriteLine("我会抓老鼠。");
        }
        public override void Eat()
        {
            base.Eat();
            Console.WriteLine("猫粮。");
        }
    }//猫
    class Sparrow :Birds
    {
        public override void Eat()
        {
            base.Eat();
            Console.WriteLine("大户人家的稻谷。");
        }
    }//麻雀
    class Vulture :Birds
    {
        public override void Eat()
        {
            base.Eat();
            Console.WriteLine("腐肉。");
        }
    }//秃鹫
}
